import lazyLoadView from '@/router/lazy-load';
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const ElderlyManagement: AppRouteRecordRaw = {
  path: '/elderly-management',
  name: 'ElderlyManagement',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.elderly',
    requiresAuth: true,
    icon: 'icon-user',
    order: 1,
    roleCode: 'GROUP_ELDER_ADMIN',
  },
  children: [
    {
      path: 'file',
      name: 'File',
      component: lazyLoadView(
        () => import('@/views/elderly-management/file-management/index.vue')
      ),
      meta: {
        locale: 'menu.elderly.file',
        requiresAuth: true,
        roleCode: 'GROUP_ELDERLY',
        pageName: '长者列表',
      },
    },
    {
      path: 'detail',
      name: 'FileDetail',
      meta: {
        locale: 'menu.elderly.fileDetail',
        requiresAuth: true,
        roleCode: 'GROUP_ELDERLY',
        hideInMenu: true,
        extra: true,
        layout: 'detail',
      },
      component: lazyLoadView(
        () => import('@/views/elderly-management/file-management/detail.vue')
      ),
    },
    {
      path: 'elder-create',
      name: 'ElderCreate',
      meta: {
        locale: 'menu.elderly.fileDetail',
        requiresAuth: true,
        roleCode: 'GROUP_ELDERLY',
        hideInMenu: true,
        extra: true,
        layout: 'detail',
      },
      component: lazyLoadView(
        () =>
          import('@/views/elderly-management/file-management/elder-create.vue')
      ),
    },

    // {
    //   path: 'service',
    //   name: 'Service',
    //   component: () =>
    //     import('@/views/elderly-management/service-management/index.vue'),
    //   meta: {
    //     locale: 'menu.elderly.service',
    //     requiresAuth: true,
    //     roleCode: 'GROUP_SERVICE',
    //   },
    // },
    // {
    //   path: 'service-detail',
    //   name: 'ServiceDetailPage',
    //   component: DETAIL_PAGE,
    //   meta: {
    //     locale: 'menu.elderly.serviceDetail',
    //     requiresAuth: true,
    //     roleCode: 'GROUP_SERVICE',
    //     hideInMenu: true,
    //   },
    //   children: [
    //     {
    //       path: '',
    //       name: 'ServiceDetail',
    //       component: () =>
    //         import('@/views/elderly-management/service-management/detail.vue'),
    //     },
    //   ],
    // },
  ],
};

export default ElderlyManagement;
